/*
 * Copyright (c) 2002-2003 by OpenSymphony
 * All rights reserved.
 */
package org.jackysoft.entity;

import java.util.Map;







import org.dom4j.Element;
import org.jackysoft.bean.define.EntitySchemas;

/**
 * 
 */



public class RegisterNode extends AbstractNode {
	// ~ Instance fields
	// ////////////////////////////////////////////////////////

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected Map<String, String> args;
	protected String type;
	protected String variableName;

	// ~ Constructors
	// ///////////////////////////////////////////////////////////

	/**
     * 
     */
	public RegisterNode() {
		super();
	}

	/**
     * 
     */
	public RegisterNode(Element element) {
		this();
		this.init(element);
	}

	@Override
	public Element asElement() {
		Element root = elementof("register");
		attr(root, "variable-name", this.variableName);
		attr(root, "type", type);
		addargs(root, args);
		return root;
	}

	
	
	
	public Map<String, String> getArgs() {
		return args;
	}

	public String getType() {
		return type;
	}

	public String getVariableName() {
		return variableName;
	}

	@Override
	protected void init(Element root) {
		this.type = root.attributeValue("type");
		this.variableName = root.attributeValue("variable-name");
		this.args = args(root);
	}

	/**
	 * 
	 */
	public void setArgs(Map<String, String> args) {
		this.args = args;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setVariableName(String variableName) {
		this.variableName = variableName;
	}

	@Override
	public String tagName() {
		// TODO Auto-generated method stub
		return "register";
	}

}
